<?php
$a=$_POST['zh'];
$b=$_POST['mm'];
$c=$_POST['nc'];
$d=$_POST['email'];
$e=$_POST['zt'];
$f=$_POST['ctime']=time();

@mysql_connect('localhost', 'root', 'root');
if (mysql_errno()) {
	die(mysql_errno());
}
mysql_select_db('blog');
mysql_set_charset('utf8');
$sql="insert into `user`(`zhanghao`,`pwd`,`nicheng`,`email`,`zhuangtai`,`ctime`) values('$a','$b','$c','$d','$e','$f') ";

$res=mysql_query($sql);

if ($res) {
    echo "<script>alert('添加成功');window.location.href='user.php'</script>";
}
else{
    die ("<script>alert('添加失败');window.location.href='user.php'</script>");
}

mysql_close();


?>